<% include ../header %>
<h2>用户的历史订单</h2>
<% orders.forEach(function(item){ %>
<table  class="table table-bordered">
  <tbody>
  <tr class="hd-row">
    <td colspan="3">
      <%=item.time%> 在<a href="/shop/<%=item.shop_id%>"> <%=item.shop_name%> </a>购买的清单
      <span>共计 <%=item.total%> 元</span>
      支付状态：<% if(item.canceled){ %>
      <span>已取消</span>
      <% } else if (item.payStatus === "paid") { %>
      <span>已支付</span>
      <% } else {%>
      <span class="text-error">未支付</span>，
      <a href="/pay/item?order_id=<%= item._id %>">右键复制支付链接</a>
      <% } %></td>
    </td>
  </tr>
  <% for(var i = 0; i < item.order.length; i++){%>
  <tr>
    <td class="shop_name-td"><%=item.order[i].name%></td>
    <td class="price-td"><%=item.order[i].price%>元</td>
    <td class="num-td"><%=item.order[i].num%>份</td>
  </tr>
  <%}%>
  </tbody>
</table>
<% }) %>
<!--<div class="actions">
  <a class="btn btn-primary" href="/admin/shop/add">添加店铺</a>
</div>-->
<% include ../footer %>